#include "sweety_3D_LightTool.h"
#include "tools/sweety_ProgramObject.h"
#include "backends/sweety_Impl_opengl3_loader.h"

namespace SW
{
	LightTool::LightTool()
	{

	}

	LightTool::~LightTool()
	{

	}

	void LightTool::Set(MainProgramObj* shader, const char* name, const vec3& val, ValType type)
	{
		SW_ASSERT(shader);
		
		/*std::string nameTemp = name;
		m_LightMap[nameTemp] = val;
		int size = m_LightMap.size();*/

		if (!strcmp("", name))
		{
			return;
		}

		if (type == ValType::ValType_Number)
		{
			glUniform1f(shader->getUniformLocation(name), val.x);
		}
		else if (type == ValType::ValType_Vector)
		{
			glUniform3fv(shader->getUniformLocation(name), 1, value_ptr(val));
		}
	}

}